<!--{eval $_TPL['titles'] = array('书写T邮');}-->
<!--{template header_tpl}-->
<div class="grid_16 main_box">
	<!--{if $self}-->
		<div class="grid_16 box"><h1>书写T邮</h1>
			<form action="{SITEURL}pm/write" method="post" accept-charset="utf-8" id="pmform">
				<table class="formtable">
					<tr>
						<th style="width:15%;">寄给:</th>
						<td><input id="name" type="text" value="$toname" name="name" class="textinput" disabled></td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<th>内容：</th>
						<td><textarea name="message" class="areainput" id="message"></textarea></td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<input type="hidden" name="touid" value="$touid" id="touid">
						<td colspan="2"><input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
						<input type="submit" name="pmsubmit" value="发送" id="pmsubmit"></td>
					</tr>
				</table>
			</form>
		</div>
	<!--{/if}-->
</div>
<div class="grid_7 omega sidebar">
	<!--{template userinfo_tpl}-->
</div>
<script src="<!--{eval echo base_url();}-->resources/js/jquery.validate.min.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/validate.messages_cn.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/validate.additional-methods.min.js" type="text/javascript"></script>
<script src="<!--{eval echo base_url();}-->resources/js/jquery.form.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	var validator = $("#pmform").validate({
		onfocusout:false,
		onkeyup:false,
		errorElement:"span",
		rules: {
			message: {
				required: true,
				minlength: 1,
				maxlength:7000
			}
		},
		messages: {
			message: {
				required: "给朋友写点什么吧.",
				minlength: "给朋友写点什么吧",
				maxlength: "您填写的内容太多了。超过了7000个汉字。"
			}
		},
		errorPlacement: function(error, element) {
			error.appendTo(element.parent("td").next("td"));
		},
		highlight: function(element, errorClass) {
				$(element).fadeOut(function() {
				$(element).fadeIn();
			});
		},
		success: function(label) {
		}
	});
});
</script>
<!--{template footer_tpl}-->